import com.mongodb.MongoClient;
import com.mongodb.MongoClientOptions;
import com.mongodb.MongoClientURI;
import com.mongodb.ReadPreference;

public class TestMongo {
    public static void main(String[] args) {
        String connurl = "mongodb://name:pass@127.0.0.1:9290/admin";
        MongoClientOptions.Builder build = new MongoClientOptions.Builder();
        build.connectionsPerHost(200);
        build.connectTimeout(60*1000);
        build.maxWaitTime(60*1000);
        build.readPreference(ReadPreference.primary());
        MongoClient mongo = new MongoClient(new MongoClientURI(connurl));
        long cont = mongo.getDatabase("cc_data_20200618").getCollection("N00000050752_customer").count();
        System.out.println("count: "  + cont);
    }
}
